Skip to content

test: cleanup resources in test_deploy_vm_iso, use base class tearDown#13136

Open
DaanHoogland wants to merge 2 commits into
mainfrom
cleanup-test-deploy-vm-iso-resources
Open

test: cleanup resources in test_deploy_vm_iso, use base class tearDown#13136
DaanHoogland wants to merge 2 commits into
mainfrom
cleanup-test-deploy-vm-iso-resources

Conversation

@DaanHoogland
Copy link
Copy Markdown
Contributor

The test was creating an ISO and a VirtualMachine without adding them to self.cleanup, so they were never deleted after each test run.

  • Add iso and virtual_machine to self.cleanup (using append) so the base-class tearDown deletes them after each test.
  • Remove the explicit tearDown override — the base class cloudstackTestCase.tearDown already calls cleanup_resources(self.apiclient, reversed(self.cleanup)).
  • Remove the explicit tearDownClass override — the base class cloudstackTestCase.tearDownClass already handles cls._cleanup for both the apiclient and api_client attribute names.
  • Rename cls.api_client → cls.apiclient in setUpClass so the base-class tearDownClass can find the client.
  • Remove the now-unused cleanup_resources import from marvin.lib.utils.

Relates to #3693

Description

This PR...

Types of changes

  • Breaking change (fix or feature that would cause existing functionality to change)
  • New feature (non-breaking change which adds functionality)
  • Bug fix (non-breaking change which fixes an issue)
  • Enhancement (improves an existing feature and functionality)
  • Cleanup (Code refactoring and cleanup, that may add test cases)
  • Build/CI
  • Test (unit or integration test code)

Feature/Enhancement Scale or Bug Severity

Feature/Enhancement Scale

  • Major
  • Minor

Bug Severity

  • BLOCKER
  • Critical
  • Major
  • Minor
  • Trivial

Screenshots (if appropriate):

How Has This Been Tested?

How did you try to break this feature and the system with this change?

@boring-cyborg boring-cyborg Bot added component:integration-test Python Warning... Python code Ahead! labels May 8, 2026
@codecov
Copy link
Copy Markdown

codecov Bot commented May 8, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 18.09%. Comparing base (72b99a3) to head (10a0404).
⚠️ Report is 9 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff            @@
##               main   #13136   +/-   ##
=========================================
  Coverage     18.08%   18.09%           
- Complexity    16718    16721    +3     
=========================================
  Files          6037     6037           
  Lines        542546   542546           
  Branches      66432    66432           
=========================================
+ Hits          98146    98157   +11     
+ Misses       433378   433368   -10     
+ Partials      11022    11021    -1     
Flag Coverage Δ
uitests 3.51% <ø> (ø)
unittests 19.25% <ø> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR aims to ensure test_deploy_vm_iso properly cleans up created resources by relying on the base cloudstackTestCase tearDown/tearDownClass cleanup mechanisms, so test runs don’t leak ISOs/VMs/accounts into the environment.

Changes:

  • Remove the test-specific tearDown/tearDownClass and rely on cloudstackTestCase cleanup handling.
  • Standardize the class client attribute name to cls.apiclient so base-class cleanup can find it.
  • Add newly created resources (ISO, VM) to self.cleanup so they’re deleted after each test.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread test/integration/smoke/test_deploy_vm_iso.py Outdated
Comment thread test/integration/smoke/test_deploy_vm_iso.py
Comment thread test/integration/smoke/test_deploy_vm_iso.py Outdated
Comment thread test/integration/smoke/test_deploy_vm_iso.py
@DaanHoogland DaanHoogland force-pushed the cleanup-test-deploy-vm-iso-resources branch from 3a234d8 to acf78ab Compare May 8, 2026 13:52
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
@apache apache deleted a comment from blueorangutan May 8, 2026
@apache apache deleted a comment from blueorangutan May 8, 2026
@DaanHoogland
Copy link
Copy Markdown
Contributor Author

@blueorangutan package

@blueorangutan
Copy link
Copy Markdown

@DaanHoogland a [SL] Jenkins job has been kicked to build packages. It will be bundled with no SystemVM templates. I'll keep you posted as I make progress.

@blueorangutan
Copy link
Copy Markdown

Packaging result [SF]: ✔️ el8 ✔️ el9 ✔️ el10 ✔️ debian ✔️ suse15. SL-JID 17789

@sonarqubecloud
Copy link
Copy Markdown

sonarqubecloud Bot commented May 8, 2026

@DaanHoogland
Copy link
Copy Markdown
Contributor Author

@blueorangutan test

@blueorangutan
Copy link
Copy Markdown

@DaanHoogland a [SL] Trillian-Jenkins test job (ol8 mgmt + kvm-ol8) has been kicked to run smoke tests

@blueorangutan
Copy link
Copy Markdown

[SF] Trillian Build Failed (tid-16089)

@DaanHoogland
Copy link
Copy Markdown
Contributor Author

@blueorangutan test

@blueorangutan
Copy link
Copy Markdown

@DaanHoogland a [SL] Trillian-Jenkins test job (ol8 mgmt + kvm-ol8) has been kicked to run smoke tests

@blueorangutan
Copy link
Copy Markdown

[SF] Trillian test result (tid-16107)
Environment: kvm-ol8 (x2), zone: Advanced Networking with Mgmt server ol8
Total time taken: 68016 seconds
Marvin logs: https://github.com/blueorangutan/acs-prs/releases/download/trillian/pr13136-t16107-kvm-ol8.zip
Smoke tests completed. 124 look OK, 6 have errors, 21 did not run
Only failed and skipped tests results shown below:

Test Result Time (s) Test File
test_vm_backup_create_vm_from_backup Failure 608.00 test_backup_recovery_nas.py
test_vm_backup_lifecycle Error 0.14 test_backup_recovery_nas.py
test_deploy_vm_from_iso Failure 5.01 test_deploy_vm_iso.py
test_deploy_vm_from_iso Error 5.02 test_deploy_vm_iso.py
test_01_port_fwd_on_src_nat Error 3.52 test_network.py
test_02_port_fwd_on_non_src_nat Error 0.01 test_network.py
ContextSuite context=TestPortForwarding>:teardown Error 1.04 test_network.py
ContextSuite context=TestPrivateVlansL2Networks>:setup Error 2.06 test_network.py
ContextSuite context=TestPublicIP>:setup Error 3.08 test_network.py
test_reboot_router Error 1.02 test_network.py
test_releaseIP Error 1.02 test_network.py
test_releaseIP_using_IP Error 1.02 test_network.py
ContextSuite context=TestRouterRules>:setup Error 2.05 test_network.py
ContextSuite context=TestSharedNetwork>:setup Error 3.07 test_network.py
ContextSuite context=TestSharedNetworkWithConfigDrive>:setup Error 4.09 test_network.py
test_01_create_vm_snapshots Failure 606.87 test_vm_snapshots.py
test_02_revert_vm_snapshots Failure 600.71 test_vm_snapshots.py
test_03_delete_vm_snapshots Failure 0.03 test_vm_snapshots.py
test_01_create_volume Failure 611.81 test_volumes.py
test_01_root_volume_encryption Failure 703.46 test_volumes.py
test_02_data_volume_encryption Failure 647.59 test_volumes.py
test_03_root_and_data_volume_encryption Failure 666.35 test_volumes.py
test_02_attach_volume Failure 1270.34 test_volumes.py
test_02_attach_volume Failure 1270.36 test_volumes.py
test_03_download_attached_volume Failure 666.56 test_volumes.py
test_04_delete_attached_volume Failure 661.43 test_volumes.py
test_05_detach_volume Failure 754.33 test_volumes.py
test_06_download_detached_volume Failure 850.83 test_volumes.py
test_07_resize_fail Failure 662.32 test_volumes.py
test_08_resize_volume Failure 670.51 test_volumes.py
test_09_delete_detached_volume Failure 664.09 test_volumes.py
test_10_list_volumes Failure 658.53 test_volumes.py
test_11_attach_volume_with_unstarted_vm Failure 765.58 test_volumes.py
test_12_resize_volume_with_only_size_parameter Failure 665.89 test_volumes.py
test_13_migrate_volume_and_change_offering Failure 799.34 test_volumes.py
test_14_delete_volume_delete_protection Failure 664.69 test_volumes.py
ContextSuite context=TestSharedFSLifecycle>:setup Error 0.00 test_sharedfs_lifecycle.py
all_test_ipv4_routing Skipped --- test_ipv4_routing.py
all_test_ipv6_infra Skipped --- test_ipv6_infra.py
all_test_list_volumes Skipped --- test_list_volumes.py
all_test_loadbalance Skipped --- test_loadbalance.py
all_test_login Skipped --- test_login.py
all_test_metrics_api Skipped --- test_metrics_api.py
all_test_migration Skipped --- test_migration.py
all_test_network_traffic_type_api Skipped --- test_network_traffic_type_api.py
all_test_nic_adapter_type Skipped --- test_nic_adapter_type.py
all_test_nic Skipped --- test_nic.py
all_test_non_contigiousvlan Skipped --- test_non_contigiousvlan.py
all_test_purge_expunged_vms Skipped --- test_purge_expunged_vms.py
all_test_pvlan Skipped --- test_pvlan.py
all_test_quarantined_ips Skipped --- test_quarantined_ips.py
all_test_usage Skipped --- test_usage.py
all_test_vm_autoscaling Skipped --- test_vm_autoscaling.py
all_test_vm_deployment_planner Skipped --- test_vm_deployment_planner.py
all_test_vm_life_cycle Skipped --- test_vm_life_cycle.py
all_test_vm_strict_host_tags Skipped --- test_vm_strict_host_tags.py
all_test_host_maintenance Skipped --- test_host_maintenance.py
all_test_hostha_kvm Skipped --- test_hostha_kvm.py

@DaanHoogland
Copy link
Copy Markdown
Contributor Author

@blueorangutan test keepEnv

@blueorangutan
Copy link
Copy Markdown

@DaanHoogland a [SL] Trillian-Jenkins test job (ol8 mgmt + kvm-ol8) has been kicked to run smoke tests

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

component:integration-test Python Warning... Python code Ahead!

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants